package cn.ctodb.cms.service.dto;

import java.time.ZonedDateTime;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;


/**
 * A DTO for the CmsContent entity.
 */
public class CmsContentDTO implements Serializable {

    private Long id;

    private String title;

    private String tpl;

    private String keyWord;

    private String description;

    private String author;

    private ZonedDateTime updateDate;

    private Integer viewCount;

    private Integer commentCount;


    private Long channelId;
    
    private Set<CmsTagDTO> tags = new HashSet<>();

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    public String getTpl() {
        return tpl;
    }

    public void setTpl(String tpl) {
        this.tpl = tpl;
    }
    public String getKeyWord() {
        return keyWord;
    }

    public void setKeyWord(String keyWord) {
        this.keyWord = keyWord;
    }
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }
    public ZonedDateTime getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(ZonedDateTime updateDate) {
        this.updateDate = updateDate;
    }
    public Integer getViewCount() {
        return viewCount;
    }

    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }
    public Integer getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelId(Long cmsChannelId) {
        this.channelId = cmsChannelId;
    }

    public Set<CmsTagDTO> getTags() {
        return tags;
    }

    public void setTags(Set<CmsTagDTO> cmsTags) {
        this.tags = cmsTags;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CmsContentDTO cmsContentDTO = (CmsContentDTO) o;

        if ( ! Objects.equals(id, cmsContentDTO.id)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "CmsContentDTO{" +
            "id=" + id +
            ", title='" + title + "'" +
            ", tpl='" + tpl + "'" +
            ", keyWord='" + keyWord + "'" +
            ", description='" + description + "'" +
            ", author='" + author + "'" +
            ", updateDate='" + updateDate + "'" +
            ", viewCount='" + viewCount + "'" +
            ", commentCount='" + commentCount + "'" +
            '}';
    }
}
